export const filters = {
  currency(value, symbol = '￥') {
    return `${symbol}${Number(value).toFixed(2)}`
  },
  date(value, format = 'YYYY-MM-DD') {
    return new Date(value).toLocaleDateString()
  }
}

export const installFilters = (app) => {
  app.config.globalProperties.$filters = filters
}